package com.toycloud.business.controller.business;

import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import com.toycloud.business.dto.params.business.FeedbackApplicationVersionManagerDetailParams;
import com.toycloud.business.dto.results.CommonResult;
import com.toycloud.common.core.utils.poi.ExcelUtil;
import com.toycloud.common.core.controller.BaseController;
import com.toycloud.system.domain.business.FeedbackApplicationVersionManagerDetail;
import com.toycloud.system.log.annotation.Log;
import com.toycloud.system.log.enums.BusinessType;
import com.toycloud.system.mapper.business.FeedbackApplicationVersionManagerDetailMapper;
import com.toycloud.system.service.business.IFeedbackApplicationVersionManagerDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 应用版本管理关联Controller
 * 
 * @author ruoyi
 * @date 2024-12-18
 */
@RestController
@RequestMapping("/appdetail")
public class FeedbackApplicationVersionManagerDetailController extends BaseController
{
    @Autowired
    private IFeedbackApplicationVersionManagerDetailService feedbackApplicationVersionManagerDetailService;
    @Resource
    private FeedbackApplicationVersionManagerDetailMapper feedbackApplicationVersionManagerDetailMapper;

    /**
     * 查询应用版本管理关联列表
     */
    @GetMapping("/list")
    public CommonResult<List<FeedbackApplicationVersionManagerDetail>> list(FeedbackApplicationVersionManagerDetailParams feedbackApplicationVersionManagerDetailParams)
    {
        return feedbackApplicationVersionManagerDetailService.selectFeedbackApplicationVersionManagerDetailList(feedbackApplicationVersionManagerDetailParams);
    }
    @GetMapping("/listDetail")
    public CommonResult<List<Map<String, Object>>> listDetail(String id)
    {
        return feedbackApplicationVersionManagerDetailService.listDetail(id);
    }

    /**
     * 导出应用版本管理关联列表
     */
    @Log(title = "应用版本管理关联", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, FeedbackApplicationVersionManagerDetailParams feedbackApplicationVersionManagerDetailParams)
    {
        List<FeedbackApplicationVersionManagerDetail> list = feedbackApplicationVersionManagerDetailMapper.selectFeedbackApplicationVersionManagerDetailList(feedbackApplicationVersionManagerDetailParams);
        ExcelUtil<FeedbackApplicationVersionManagerDetail> util = new ExcelUtil<FeedbackApplicationVersionManagerDetail>(FeedbackApplicationVersionManagerDetail.class);
        util.exportExcel(response, list, "应用版本管理关联数据");
    }


}
